package com.tzr.web;

import com.tzr.bean.Weibo;
import com.tzr.service.UserDaoService;
import com.tzr.service.UserDaoServiceImpl;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(value = "/pinglun")
public class PingLunServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1.接收参数
        String uname = req.getParameter("uname");
        String pinglun = req.getParameter("note");
        //2.获取service方法
        UserDaoService userDaoService = new UserDaoServiceImpl();
        boolean u = userDaoService.PingLun(uname,pinglun);
        resp.getWriter().print(u);
        System.out.println(uname);
        System.out.println(pinglun);
    }
}
